/* 图库管理样式 */

/* 图库容器 */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面标题和操作栏 */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.gallery-header h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin: 0;
}

.gallery-header h1 i {
    color: #3498db;
    margin-right: 10px;
}

.gallery-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 筛选和搜索栏 */
.gallery-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
}

.btn-search {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-search:hover {
    background: #2980b9;
}

/* 图库统计信息 */
.gallery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    color: #3498db;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

/* 图片网格展示 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.image-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.image-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-card:hover .image-preview img {
    transform: scale(1.05);
}

.image-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.image-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.image-status.active {
    background: rgba(39, 174, 96, 0.9);
}

.image-info {
    padding: 15px;
}

.image-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-description {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 10px;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.tag {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.image-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 15px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-header h3 i {
    color: #3498db;
    margin-right: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #3498db;
    background: #f8f9fa;
}

.file-upload-area i {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.file-upload-area p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info i {
    color: #3498db;
}

.file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
}

/* 图片预览 */
.image-preview {
    text-align: center;
    margin-bottom: 20px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 统计图表 */
.stats-container {
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.stat-item h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

.stats-chart {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #7f8c8d;
}

/* 加载遮罩 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-container {
        padding: 10px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: center;
    }
    
    .search-group input {
        min-width: auto;
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% 5%;
        width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s;
}

.checkbox-label input:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 按钮样式增强 */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 轮番图管理样式 */
.carousel-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
}

.section-header h2 i {
    color: #e67e22;
    margin-right: 10px;
}

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.carousel-info {
    background: #f8f9fa;
    border-left: 4px solid #e67e22;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.carousel-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

.carousel-info i {
    color: #e67e22;
    margin-right: 8px;
}

/* 轮番图网格 */
.carousel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.carousel-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.carousel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.carousel-preview-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.carousel-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel-preview:hover {
    transform: scale(1.05);
}

.carousel-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e67e22;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.carousel-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.carousel-status.active {
    background: #27ae60;
    color: white;
}

.carousel-status.inactive {
    background: #95a5a6;
    color: white;
}

.carousel-info {
    padding: 15px;
}

.carousel-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-description {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    line-height: 1.4;
}

.carousel-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 15px;
}

.carousel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-sort-up, .btn-sort-down {
    background: #95a5a6;
    color: white;
}

.btn-sort-up:hover, .btn-sort-down:hover {
    background: #7f8c8d;
}

.btn-sort-up:disabled, .btn-sort-down:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* 轮番图预览模态框 */
.modal-large {
    max-width: 800px;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.preview-info {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.preview-info h3 {
    margin-top: 0;
    color: #2c3e50;
}

.preview-info p {
    margin: 8px 0;
    color: #7f8c8d;
}

.preview-info strong {
    color: #2c3e50;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-actions {
        justify-content: center;
    }
}